ncbi-blast+ 2.17.0+ds-2: Fix ZCF CRC32C logistics with SIMDE help.
authorAaron M. Ucko <ucko@debian.org>
Wed, 1 Oct 2025 18:43:26 +0000 (14:43 -0400)
committerAaron M. Ucko <ucko@debian.org>
Wed, 1 Oct 2025 18:43:26 +0000 (14:43 -0400)
* debian/control:
  - Additionally build-depend on libsimde-dev.
  - Require CRC support on ARM per upstream.
* debian/patches/zcf-simde-crc32c (new): Replace Cloudflare deflate.c's
  fallbackless architecture-dependent code with a SIMDE invocation that
  amounts to the same thing on supported architectures and to a portable
  fallback elsewhere.

debian/changelog
debian/control
debian/patches/series
debian/patches/zcf-simde-crc32c [new file with mode: 0644]

index 71c30de6089f49a44db1c7e03b62af1336479373..c1ac89778d5e5b9dfed0cf011d7d063c580c95ea 100644 (file)
@@ -1,3 +1,15 @@
+ncbi-blast+ (2.17.0+ds-2) unstable; urgency=medium
+
+  * debian/control:
+    - Additionally build-depend on libsimde-dev.
+    - Require CRC support on ARM per upstream.
+  * debian/patches/zcf-simde-crc32c (new): Replace Cloudflare deflate.c's
+    fallbackless architecture-dependent code with a SIMDE invocation that
+    amounts to the same thing on supported architectures and to a portable
+    fallback elsewhere.
+
+ -- Aaron M. Ucko <ucko@debian.org>  Wed, 01 Oct 2025 14:43:25 -0400
+
 ncbi-blast+ (2.17.0+ds-1) unstable; urgency=medium
 
   * New upstream release.
index 7234c3e6a1a0521006206d6e535b8aac6b84bc17..4e04f26cbcc7fffb2c9ca89d2894bc032d9ea5f6 100644 (file)
@@ -20,6 +20,7 @@ Build-Depends-Arch:
  libncbi-vdb-dev [amd64 arm64 x32],
  libnghttp2-dev,
  libpcre2-dev,
+ libsimde-dev,
  libsqlite3-dev,
  libuv1-dev,
  time,
@@ -34,6 +35,7 @@ Package: ncbi-blast+
 Architecture: any
 Multi-Arch: foreign
 Depends:
+ armv8crc-support [any-arm arm64],
  ncbi-data,
  python3,
  sse4.2-support [any-amd64 any-i386 any-x32],
index 5c34fb88a3d3e228d53d40367e758e8d00ba5b41..a4fb8620e67669b874813eaec8f09cd8b1bedab6 100644 (file)
@@ -22,3 +22,4 @@ tune_lmdb_defaults
 2to3
 big_endian_workaround
 # fix_bm_for_gcc15
+zcf-simde-crc32c
diff --git a/debian/patches/zcf-simde-crc32c b/debian/patches/zcf-simde-crc32c
new file mode 100644 (file)
index 0000000..939b138
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/c++/src/util/compress/zlib_cloudflare/deflate.c
++++ b/c++/src/util/compress/zlib_cloudflare/deflate.c
+@@ -129,27 +129,11 @@ static const config configuration_table[
+ /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+ #define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
+-#ifdef __aarch64__
+-
+-#include <arm_neon.h>
+-#include <arm_acle.h>
+-static uint32_t hash_func(deflate_state *s, void* str) {
+-    return __crc32cw(0, *(uint32_t*)str) & s->hash_mask;
+-}
+-
+-#elif defined __x86_64__ || defined _M_AMD64
+-
+-#include <immintrin.h>
++#include <simde/x86/sse4.2.h>
+ static uint32_t hash_func(deflate_state *s, void* str) {
+-    return _mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
++    return simde_mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
+ }
+-#else
+-
+-#error "Only 64-bit Intel and ARM architectures are supported"
+-
+-#endif
+-
+ /* ===========================================================================
+  * Insert string str in the dictionary and return the previous head
+  * of the hash chain (the most recent string with same hash key).